package com.edu.exam.enums.analysis;

/**
 * 分析类型枚举
 */
public enum AnalysisType {
    ITEM_ANALYSIS("ITEM_ANALYSIS", "项目分析"),
    DIFFICULTY_ANALYSIS("DIFFICULTY_ANALYSIS", "难度分析"),
    DISCRIMINATION_ANALYSIS("DISCRIMINATION_ANALYSIS", "区分度分析"),
    VALIDITY_ANALYSIS("VALIDITY_ANALYSIS", "效度分析"),
    RELIABILITY_ANALYSIS("RELIABILITY_ANALYSIS", "信度分析"),
    RESPONSE_ANALYSIS("RESPONSE_ANALYSIS", "回答分析"),
    TIME_ANALYSIS("TIME_ANALYSIS", "时间分析"),
    GROUP_ANALYSIS("GROUP_ANALYSIS", "群体分析"),
    TREND_ANALYSIS("TREND_ANALYSIS", "趋势分析"),
    COMPREHENSIVE("COMPREHENSIVE", "综合分析"),
    DIAGNOSTIC("DIAGNOSTIC", "诊断分析"),
    PREDICTIVE("PREDICTIVE", "预测分析");

    private final String code;
    private final String description;

    AnalysisType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static AnalysisType fromCode(String code) {
        for (AnalysisType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return ITEM_ANALYSIS;
    }
}